package cn.bugstack.domain.strategy.model.valobj;

import cn.bugstack.domain.strategy.service.rule.filter.factory.DefaultLogicFactory;
import cn.bugstack.types.common.Constants;
import lombok.Builder;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

/**
 * @Title: StrategyAwardRuleModelVO
 * @Description:
 * @author: jiangta
 * @date: 2024/10/28 下午7:53
 * @Version: 1.0
 */
@Getter
@Builder
public class StrategyAwardRuleModelVO {

    private String ruleModels;

    public String[] raffleCenterRuleModelList() {
        List<String> ruleModelsList = new ArrayList<>();
        String[] ruleModelValues = ruleModels.split(Constants.SPLIT);
        for(String ruleModelValue : ruleModelValues) {
            if(DefaultLogicFactory.LogicModel.isCenter(ruleModelValue)) {
                ruleModelsList.add(ruleModelValue);
            }
        }
        return ruleModelsList.toArray(new String[ruleModelsList.size()]);
    }
}